import { http } from '@/utils/http';
import { Activity } from '@/service/types/activity';

/** 获取活动列表 */
export const GetEventInfoPage = (data, query) => {
  return http.post<IResDataInfo<Activity.EventInfoPageItem>>('/event-info/page', data, query)
}

/** 获取活动详情 */
export const GetEventInfo = (data) => {
  return http.get<Activity.ActivityDetail>('/event-info', data)
}

/** 报名活动 */
export const EventRegistrationInfo = (data) => {
  return http.post<Activity.ActivitySignUp>('/event-registration-info', data)
}

/** 发布活动 */
export const SetEventInfo = (data) => {
  return http.post<Activity.EventInfoPageItem>('/event-info', data)
}

/** 获取活动报名表详情 */
export const GetEventRegistrationInfo = (data: { id: string }) => {
  return http.get<any>('/event-registration-info', data)
}

/** 获取用户活动信息表详情 */
export const GetUserActivityInfoQueryByUser = (data: { 
  userId: string;
}) => {
  return http.get<Activity.ActivityInfo>('/user-activity-info/queryByUser', data)
}

/** 添加用户活动 */
export const AddUserActivityInfo = (data) => {
  return http.post<any>('/user-activity-info/addInfo', data)
}

/** 报名活动（微信支付） */
export const EventRegistrationInfoEventWechat = (data) => {
  return http.post<any>('/event-registration-info/event_wechat', data)
}